package com.atguigu.java;

public class InstanceTest {
		public static void main(String[] args) {
				Phone p = new Phone();
				
				p.sendEmail();
				p.playGame();
				
				
				//匿名对象
				new Phone().sendEmail();
				new Phone().playGame();
				
				new Phone().price = 1999;
				new Phone().showPrice();
				
				//***************************
				PhoneMall mall = new PhoneMall();
				mall.show(new Phone());
		}
}

class PhoneMall{
		
		public void show(Phone phone){
				phone.sendEmail();
				phone.playGame();
		}
}


class Phone{
		double price;
		
		public void sendEmail(){
				System.out.println("发送邮件");
		}
		
		public void playGame(){
				System.out.println("玩游戏");
		}
		
		public void showPrice(){
			System.out.println(price);
		}
}
